import request from '@/utils/request'

// 查询缺陷定义列表
export function listDefinition(query) {
  return request({
    url: '/quality/definition/list',
    method: 'get',
    params: query
  })
}

// 查询缺陷定义详细
export function getDefinition(id) {
  return request({
    url: '/quality/definition/' + id,
    method: 'get'
  })
}

// 新增缺陷定义
export function addDefinition(data) {
  return request({
    url: '/quality/definition',
    method: 'post',
    data: data
  })
}

// 修改缺陷定义
export function updateDefinition(data) {
  return request({
    url: '/quality/definition',
    method: 'put',
    data: data
  })
}

// 删除缺陷定义
export function delDefinition(ids) {
  return request({
    url: '/quality/definition/' + ids,
    method: 'delete'
  })
}

// 导出缺陷定义
export function exportDefinition(query) {
  return request({
    url: '/quality/definition/export',
    method: 'get',
    params: query
  })
}

// 责任部门列表
export function listDepartment(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}
